package configmap

import (
	"gitee/yinlai/kms-backend/controllers/configmap"
	"github.com/gin-gonic/gin"
)

// 实现添加集群
func create(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/create", configmap.Create)
}

// 更新集群
func update(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/update", configmap.Update)
}

// 删除
func delete(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/delete", configmap.Delete)
}

// 删除列表
func deleteList(configmapGroup *gin.RouterGroup) {
	configmapGroup.POST("/deleteList", configmap.DeleteList)
}

// 获取
func get(configmapGroup *gin.RouterGroup) {
	configmapGroup.GET("/get", configmap.Get)
}

// 获取集群列表
func list(configmapGroup *gin.RouterGroup) {
	configmapGroup.GET("/list", configmap.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	configmapGroup := g.Group("/configmap")
	create(configmapGroup)
	update(configmapGroup)
	delete(configmapGroup)
	get(configmapGroup)
	list(configmapGroup)
	deleteList(configmapGroup)
}
